define(["jquery"],function($){
	return function(itemNum,contentType){
		
		$.ajax({
			
			url:"https://open.lenovo.com.cn/goods/detail/mget?isDetail=false",
			data:{code:"1005308,1005068,1004787,1005176,1005529,1005530,1005695,1004643,1004533,1003599,1003597,1002905,1005075,1005077,1004444,1004037,1000179,1004927,1003170,1002305,1002496,1002955,1002494,1004582&_=1567414913489"},
			dataType:"jsonp",
			jsonp:"jsonpCallback",
			success:function(data){
				//console.log(data.result[itemNum[2]].detail);
				
				//判断conten的类型
				let n = 0; //默认的content的type为0 type1 = 0，type2 = 1， type3 = 2
				let ulFun = $(".type1 .uls"); //不同的选择器
				//console.log(ulFun);
				if(contentType == 0){ //第一个内容模块
				//	console.log($(".type1 .uls").children());
					
					n = Array.from($(".type1 .uls").children());
					ulFun = $(".type1 .uls");
					
				}else if(contentType == 1){ //第二个内容模块
					//console.log($(".type2 .uls").children());
					
					n = Array.from($(".type2 .uls").children());
					ulFun = $(".type2 .uls");
					
				}else if(contentType == 2){ //第三个内容模块
					//console.log($(".type3 .uls").children());
					
					n = Array.from($(".type3 .uls").children());
					ulFun = $(".type3 .uls");
					
				}
				console.log("eee");
				//console.log(itemNum[0])
				for(let i = 0;i<n.length;i++){
					//console.log(data.result[itemNum[i]].detail.thumbnail);
					ulFun.children().eq(i)[0].innerHTML = `
							<li>
								<div class="contentMsg">
									<div class="imgWrap">
											<a href="#"><img src="${data.result[itemNum[i]].detail.thumbnail}"/></a>
									</div>
									<div class="itemInfo">
										<p class="title">${data.result[itemNum[i]].detail.name}</p>
										<p class="subtitle">${data.result[itemNum[i]].detail.brief}</p>
										<p class="price">¥${data.result[itemNum[i]].detail.basePrice} </p>
									</div>
								</div>

							</li>`
					
				}
						
			}
		})
	}
})
		